/*
 * @Author: wuqingchun
 * @Date: 2024-10-29 20:02:36
 * @Description: 
 * @LastEditors: wuqingchun
 * @LastEditTime: 2024-10-30 11:24:06
 */
#include <cstdio>
#include <cstring>
#include <cerrno>

#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include <netinet/in.h>

#include "libnet.h"
#include "libnet_error.h"
#include "net_connection_passive.h"


CNetConnectionPassive::CNetConnectionPassive(INetEventHandler& refEventHandler, INetTCPConnectionCallback& refCallback, const sockaddr_in& refAddr, int iListenerFd):
    CNetConnectionBase(refEventHandler, refCallback, refAddr),
    m_iListenerFd(iListenerFd)
{

}

CNetConnectionPassive::~CNetConnectionPassive()
{
    Exit();
}

int32_t CNetConnectionPassive::Init()
{
    return CNetConnectionBase::InitPassive(m_iListenerFd);
}

void CNetConnectionPassive::Exit()
{
    CNetConnectionBase::Close();
}